package com.weilai.common.service;

import com.weilai.common.dao.MedalMapper;
import com.weilai.common.model.Medal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Song on 2017/6/3.
 */
@Service
public class MedalService {
    @Autowired
    MedalMapper medalMapper;


    public Integer updataMedalCount(Medal medal) {
        return medalMapper.updateByPrimaryKeySelective(medal);
    }

    public int addMedal(Medal medal) {
        return medalMapper.insert(medal);
    }

    public int delMedal(Medal medal) {
        return medalMapper.deleteByPrimaryKey(medal.getId());
    }
}
